local xiejuntuan = fk.CreateSkill {
  name = "lingling__xiejuntuan",
}

Fk:loadTranslationTable {
  ["lingling__xiejuntuan"] = "械军团",
  [":lingling__xiejuntuan"] = "你可以将武器牌当无次数距离限制的【杀】使用。",

  ["#lingling__xiejuntuan"] = "械军团：你可以将武器牌当无次数限制的【杀】使用",
}

xiejuntuan:addEffect("viewas", {
  anim_type = "offensive",
  mute_card = false,
  pattern = "slash",
  prompt = "#lingling__xiejuntuan",
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).sub_type == Card.SubtypeWeapon
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 then return end
    local card = Fk:cloneCard("slash")
    card.skillName = xiejuntuan.name
    card:addSubcards(cards)
    return card
  end,
  before_use = function(self, player, use)
    use.extraUse = true
  end,
  enabled_at_response = function (self, player, response)
    return not response
  end,
})

xiejuntuan:addEffect("targetmod", {
  bypass_distances = function(self, player, skill, card, to)
    return card and table.contains(card.skillNames, "th_xiejuntuan")
  end
})

xiejuntuan:addAI(nil, "vs_skill")

return xiejuntuan
